package com.elinkway.infinitemovies.ui.activity;

import android.app.Activity;
import android.view.View;
import android.widget.ImageView;

import com.elinkway.infinitemovies.utils.MoviesUtils;
import com.le123.ysdq.R;

public class FirstReleaseActivityHelper {

	private static FirstReleaseActivityHelper mInstance;
	
	private Activity mActivity;
	
	private ImageView mFirstReleaseIcon;
	
	private final String BAIDU = "baidu";
	
	private final String CHANNEL91 = "91";
	
	private final String ANZHUO = "hiapk";
	
	private final String QQ = "tencent";
	
	private FirstReleaseActivityHelper(){
		
	}
	
	public static FirstReleaseActivityHelper getInstance() {
		if(null == mInstance) {
			mInstance = new FirstReleaseActivityHelper();
		}
		return mInstance;
	}
	
	public void setActivity(Activity activity) {
		mActivity = activity;
		initView();
		setIcon();
	} 
	
	private void initView() {
		mFirstReleaseIcon = (ImageView) mActivity
				.findViewById(R.id.firstreleaseicon);
	}
	
	private void setIcon() {
		String channel = MoviesUtils.getClientChannel();
		if (QQ.equalsIgnoreCase(channel)) {
			mFirstReleaseIcon
					.setBackgroundResource(R.drawable.firstrelease_baidufamily);
			mFirstReleaseIcon.setVisibility(View.VISIBLE);
		} else {
			mFirstReleaseIcon.setVisibility(View.GONE);
		}
	}
	
}
